#ifndef MULTIPLEINHERITANCE_H
#define MULTIPLEINHERITANCE_H
#include <iostream>
class A{
public:
	A():a(1){std::cout<<"constructor A"<<std::endl;}
	A(int a):a(a){std::cout<<"constructor A with parameters"<<std::endl;}
	~A(){std::cout<<"destructor A"<<std::endl;}
protected:
	int a;
};
class B:public  virtual A{
public:
	B():b(2){std::cout<<"constructor B"<<std::endl;}
	~B(){std::cout<<"destructor B"<<std::endl;}
protected:
	int amb;
private:
	int b;
};
class C:public virtual A{
public:
	C():c(3){std::cout<<"constructor C"<<std::endl;}
	~C(){std::cout<<"destructor C"<<std::endl;}
	virtual void vf(){std::cout<<"function vf in class C"<<std::endl;}
private:
	int c;
};
class D:public B,public C{
public:
	D():d(4),A(5){std::cout<<"constructor D"<<std::endl;}
	~D(){std::cout<<"destructor D"<<std::endl;}
	int geta(){return a;}
	void test(){std::cout<<"test function in class D"<<std::endl;}
private:
	int d;
};
#endif